type CustomApi = {
    getList: (pageIndex:number, pageSize:number) => Promise<any>;
    add: (opts:any) => Promise<any>;
    getDetail: (id:number) => Promise<any>;
    put: (id:number,opts: any) => Promise<any>;
}

export default <CustomApi> {
    // get请求
    // ?scope=generic&pageSize=300&sortField=id&sortOrder=DESC
    add: async (opts: any) => await getFetchData('/tenant','post',opts),
    getList: async (pageIndex:number=1, pageSize:number=10) => await getFetchData('/tenant/list','get',{pageIndex, pageSize}),  
    getDetail: async (id:number) => await getFetchData('/tenant?id=' + id,'get'),
    put: async (id:number,opts: any) => await getFetchData('/tenant?id=' + id,'put', opts),
}